package lihao3;

public class Test7 implements Runnable{
    @Override
    public void run() {
        for (int i = 1; i <= 10; i++) {
            System.out.println("A----" + i);
            try {
                Thread.sleep(1009);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args){
        Test7 d1 = new Test7();
        Thread thread = new Thread(d1,"A");
        thread.start();

        for (int i = 10; i >=1 ; i--) {
            System.out.println("B----" + i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
